/**
 * outsider.com.cn Inc.
 * Copyright (c) 2011-2022 All Rights Reserved.
 */
package com.yuanmeng.common.core.enums;

import com.yuanmeng.common.core.exception.ServiceException;

import lombok.Getter;

/**
 * @author outsider
 * @version Id: ApproveStatusEnum.java, v 0.1 2022/6/1 17:12 outsider Exp $$
 */
@Getter
public enum WithdrawalMethodEnum {

    WECHAT("WECHAT", "微信"),

    ALIPAY("ALIPAY", "支付宝"),

    BANK("BANK", "银行卡");

    private String code;

    private String message;

    WithdrawalMethodEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static void validateWithdrawalMethod(String withdrawalMethod) {
        int num = 0;
        for(WithdrawalMethodEnum ENUM : WithdrawalMethodEnum.values()) {
            if(ENUM.code.equals(withdrawalMethod)) {
                num ++;
            }
        }
        if(num == 0) {
            throw new ServiceException("请求参数非法：withdrawalMethod");
        }
    }
}